import csv,sys

assert sys.argv[1] != sys.argv[4]

listreader = csv.reader(open(sys.argv[1],'r'),delimiter='\t')
listwriter = csv.writer(open(sys.argv[4],'w'),delimiter='\t')

col = int(sys.argv[2])
th = float(sys.argv[3])

for line in listreader:

    if float(line[col]) <= th:
        listwriter.writerow(line)
        
